package com.face.receive.jsu;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.face.operate.jsu.LostMessage;
import com.face.operate.jsu.LostToken_Operate;
@WebServlet("/DeleteLost")
public class DeleteLost extends HttpServlet {

	String saveDir = "/root/lost/";
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		String username = request.getParameter("username");
		String name = request.getParameter("name");
	
		LostMessage lostMessage = new LostMessage();
		LostToken_Operate lost = new LostToken_Operate();
		//删除寻人启事同时将图片文件删除，并将对应的facetoken一并删除
		lost.deleteByUsernameAndName(saveDir,username,name);
		lostMessage.deleteByUsernameAndName(username,name);
	}

}
